import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBApplication.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/yb_chinese_text/yb_chinese_text.dart';

class YBWenZhangZhengShiWeChatPage extends StatelessWidget {

  final String wechatUrl;

  const YBWenZhangZhengShiWeChatPage({Key key, this.wechatUrl}) : super(key: key);


  @override
  Widget build(BuildContext context) {
    return Container(
      child: Scaffold(
        appBar: AppBar(
          title: Text(YBChineseText.workTaiZhuanFaWenZhangTitle,style: YBTextStyle.TextStyle30313320Medium,),
          elevation: 0,
          actions: [
            Container(
              child: InkWell(
                child: Padding(
                  padding: EdgeInsets.only(right: YBTextStyle.adapterSize20),
                  child: Center(
                    child: Text(YBChineseText.workTaiNextStepTitle,style: YBTextStyle.TextStyle1C1D1F15,),
                  ),
                ),
                onTap: () async {
                  YBApplication.router.navigateTo(context, '/workTaiPage/workTaizhuanzaiWechatWenZhangPage/workTaizhuanzaiWechatDisplayPage/workTaizhuanzaiWechatFengMainYePage?wechatUrl=${Uri.encodeComponent(wechatUrl)}');
                },
              ),
            ),
          ],
        ),
        body: WebView(
          initialUrl: wechatUrl,
          onPageStarted: (url){
            EasyLoading.show(status: "读取中...");
          },
          onPageFinished: (url){
            EasyLoading.dismiss();
          },
          javascriptMode: JavascriptMode.unrestricted,
        ),
      ),
    );
  }
}
